<!DOCTYPE html>
<html>
<head>
    <title>{$category.name} {$category.seo_title} {$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$category.seo_keywords},{$site_info.site_seo_keywords|default=''}"/>
    <meta name="description" content="{$category.seo_description},{$site_info.site_seo_description|default=''}">
    <include file="public@head"/>
    <hook name="before_head_end"/>

</head>
<body class="body-white">
<include file="public@nav"/>
<div class="container" style="margin-top: 50px;">
    <php>$demo_time=2;</php>
    <h1 style="margin-bottom:20px; ">{$category.name}</h1>
    <div class="row">
        <div class="col-md-9">
            <div class="">
                <php>
                    $where=[
                    'post.create_time'=>['egt',0]
                    ];
                    $page=[
                        'list_rows'=>10,
                        'next'=>'下一页',
                        'prev'=>'上一页'
                    ];
                </php>
                <portal:articles item="vo" where="$where" order="post.create_time DESC" page="$page"
                                 relation="categories"
                                 categoryIds="$category.id"
                                 returnVarName="articles_data">
                    <div class="list-boxes" style="position: relative;">
                            <a style="display:inline-block; width: 90px;height: 90px;vertical-align:middle"
                                    href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}">
                                <if condition="empty($vo.more.thumbnail)">
                                    <img src="__TMPL__/public/assets/images/default_tupian4.png"
                                         class="img-responsive" alt="{$vo.post_title}"/>
                                    <else/>
                                    <img src="{:cmf_get_image_url($vo.more.thumbnail)}"
                                         class="img-responsive" alt="{$vo.post_title}"/>
                                </if>
                            </a>
                        <div style="width: 710px; padding-left:20px;display:inline-block;vertical-align:middle" class="xy_list-div">
                            <h2><a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}">{$vo.post_title}</a>
                            </h2>
                            <p>{$vo.post_excerpt}</p>
                            <div>
                                <div class="pull-left">
                                    <div class="list-actions">
                                        <a href="javascript:;"><i class="fa fa-eye"></i><span>{$vo.post_hits}</span></a>
                                        <a href="{:url('portal/Article/doLike',array('id'=>$vo['id']))}"
                                           class="js-count-btn"><i class="fa fa-thumbs-up"></i><span class="count">{$vo.post_like}</span></a>
                                        <a href="{:url('user/Favorite/add',array('id'=>$vo['id'],'cid'=>$category['id']))}"
                                           class="js-favorite-btn"
                                           data-id="{$vo.id}"
                                           data-table="portal_post"
                                           data-title="{:base64_encode($vo.post_title)}"
                                           data-url="{:cmf_url_encode('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}"
                                        >
                                            <i class="fa fa-star-o"></i>
                                        </a>
                                    </div>
                                </div>
                                <a class="btn btn-warning btn-sm pull-right"
                                   href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}">查看更多</a>
                            </div>
                        </div>

                    </div>
                </portal:articles>

            </div>
            <ul class="pagination">
                <page/>
            </ul>
        </div>
        <div class="col-md-3">

            <widget name="hottest_articles">
                <div class="tc-box">
                    <div class="headtitle">
                        <h2>{$widget.title}</h2>
                    </div>
                    <div class="ranking">
                        <php>
                            $hot_articles=[];
                        </php>
                        <ul class="list-unstyled">
                            <portal:articles limit="5" order="post.post_hits DESC"
                                             categoryIds="$widget.vars.hottest_articles_category_id">
                                <php>$top=$key<3?"top3":"";</php>
                                <li class="{$top}">
                                    <i>{$key+1}</i>
                                    <a title="{$vo.post_title}"
                                       href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">
                                        {$vo.post_title}
                                    </a>
                                </li>
                            </portal:articles>
                        </ul>
                    </div>
                </div>
            </widget>


            <widget name="last_articles">
                <div class="tc-box">
                    <div class="headtitle">
                        <h2>{$widget.title}</h2>
                    </div>
                    <div class="posts">
                        <portal:articles limit="5" order="post.published_time DESC"
                                         categoryIds="$widget.vars.last_articles_category_id">
                            <dl class="dl-horizontal">
                                <dt>
                                    <a class="img-wraper"
                                       href="{:cmf_url('portal/Article/index',array('id'=>$vo.id))}">
                                        <if condition="empty($vo.more.thumbnail)">
                                            <img src="__TMPL__/public/assets/images/default_tupian4.png"
                                                 class="img-responsive" alt="{$vo.post_title}"/>
                                            <else/>
                                            <img src="{:cmf_get_image_url($vo.more.thumbnail)}"
                                                 class="img-responsive" alt="{$vo.post_title}"/>
                                        </if>
                                    </a>
                                </dt>
                                <dd>
                                    <a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">{$vo.post_title}</a>
                                </dd>
                            </dl>
                        </portal:articles>
                    </div>
                </div>
            </widget>

        </div>
    </div>

</div>
<include file="public@scripts_footer" />
<include file="public@footer_jh"/>
<include file="public@scripts_xy"/>

<hook name="before_body_end"/>
</body>
</html>